package com.yq.tanhua.net.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.Date;

public class UserInfo implements Parcelable {

     private Long id; //用户id
    private String nickname; //昵称
    private String avatar; //用户头像
    private String birthday; //生日
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String income; //收入
    private String education; //学历
    private String profession; //行业
    private Integer marriage; //婚姻状态
    private String tags; //用户标签：多个用逗号分隔
    private String coverPic; // 封面图片
    private Date created;
    private Date updated;

    //环信账号Miami
    private String hxId;
    private String hxPwd;


    public String getHxId() {
        return hxId;
    }

    public void setHxId(String hxId) {
        this.hxId = hxId;
    }

    public String getHxPwd() {
        return hxPwd;
    }

    public void setHxPwd(String hxPwd) {
        this.hxPwd = hxPwd;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getIncome() {
        return income;
    }

    public void setIncome(String income) {
        this.income = income;
    }

    public String getEducation() {
        return education;
    }

    public void setEducation(String education) {
        this.education = education;
    }

    public String getProfession() {
        return profession;
    }

    public void setProfession(String profession) {
        this.profession = profession;
    }

    public Integer getMarriage() {
        return marriage;
    }

    public void setMarriage(Integer marriage) {
        this.marriage = marriage;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public String getCoverPic() {
        return coverPic;
    }

    public void setCoverPic(String coverPic) {
        this.coverPic = coverPic;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.nickname);
        dest.writeString(this.avatar);
        dest.writeString(this.birthday);
        dest.writeString(this.gender);
        dest.writeValue(this.age);
        dest.writeString(this.city);
        dest.writeString(this.income);
        dest.writeString(this.education);
        dest.writeString(this.profession);
        dest.writeValue(this.marriage);
        dest.writeString(this.tags);
        dest.writeString(this.coverPic);
        dest.writeLong(this.created != null ? this.created.getTime() : -1);
        dest.writeLong(this.updated != null ? this.updated.getTime() : -1);
        dest.writeString(this.hxId);
        dest.writeString(this.hxPwd);
    }

    public void readFromParcel(Parcel source) {
        this.id = (Long) source.readValue(Long.class.getClassLoader());
        this.nickname = source.readString();
        this.avatar = source.readString();
        this.birthday = source.readString();
        this.gender = source.readString();
        this.age = (Integer) source.readValue(Integer.class.getClassLoader());
        this.city = source.readString();
        this.income = source.readString();
        this.education = source.readString();
        this.profession = source.readString();
        this.marriage = (Integer) source.readValue(Integer.class.getClassLoader());
        this.tags = source.readString();
        this.coverPic = source.readString();
        long tmpCreated = source.readLong();
        this.created = tmpCreated == -1 ? null : new Date(tmpCreated);
        long tmpUpdated = source.readLong();
        this.updated = tmpUpdated == -1 ? null : new Date(tmpUpdated);
        this.hxId = source.readString();
        this.hxPwd = source.readString();
    }

    public UserInfo() {
    }

    protected UserInfo(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.nickname = in.readString();
        this.avatar = in.readString();
        this.birthday = in.readString();
        this.gender = in.readString();
        this.age = (Integer) in.readValue(Integer.class.getClassLoader());
        this.city = in.readString();
        this.income = in.readString();
        this.education = in.readString();
        this.profession = in.readString();
        this.marriage = (Integer) in.readValue(Integer.class.getClassLoader());
        this.tags = in.readString();
        this.coverPic = in.readString();
        long tmpCreated = in.readLong();
        this.created = tmpCreated == -1 ? null : new Date(tmpCreated);
        long tmpUpdated = in.readLong();
        this.updated = tmpUpdated == -1 ? null : new Date(tmpUpdated);
        this.hxId = in.readString();
        this.hxPwd = in.readString();
    }

    public static final Creator<UserInfo> CREATOR = new Creator<UserInfo>() {
        @Override
        public UserInfo createFromParcel(Parcel source) {
            return new UserInfo(source);
        }

        @Override
        public UserInfo[] newArray(int size) {
            return new UserInfo[size];
        }
    };
}